package com.gxa.service.impl;

import com.gxa.domain.dto.StockDTO;
import com.gxa.domain.entity.Stock;
import com.gxa.domain.vo.StockVO;
import com.gxa.mapper.StockMapper;
import com.gxa.service.StockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * User: gxb
 * Date: 2024/07/18  14:31
 * Description:
 * Version: V1.0
 */
@Service//IOC注解  把当前service创建一个对象 交给spring进行管理
@Transactional//开启事务 事务是指逻辑上的一组要操作，要么都成功，要么都是失败
public class StockServiceImpl implements StockService {
    @Autowired
    private StockMapper stockMapper;


    @Override
    public List<StockVO> findStockAll() {
        return stockMapper.findStockAll();
    }

    @Override
    public List<Stock> findStockByWhere(StockDTO StockDTO) {
        return stockMapper.findStockByWhere(StockDTO);
    }
}
